import axios from "axios";
//初始化
const $axios = axios.create({
    baseURL: "http://localhost:54814/api/",
    timeout: 9000
})

//请求
$axios.interceptors.request.use(config => {
    
    const token = localStorage.getItem('token')
    if (token) {
        config.headers.Authorization = 'Bearer ' + token;
    }
    return config;
})

//导出
export default $axios